

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/paginas/template.xhtml">



	<ui:define name="corpoForm">



		<h:form id="formBotoesBoleto" prependId="false">
			<p:panelGrid columns="1" styleClass="botoes" id="botoes">
				<p:commandButton id="botaoCriarBoleto" value="#{rsc.label_criar}"
					rendered="#{p:ifGranted('GERAR_BOLETO')}" styleClass="botao"
					action="#{manterBoletoBean.criarEntidade}" ajax="false"
					title="#{rsc.title_criar}" />
			</p:panelGrid>
		</h:form>

		<f:event type="javax.faces.event.PreRenderComponentEvent"
			listener="#{manterBoletoBean.preRenderList}" />
		<h:form id="formListBoletos" prependId="false">

			<p:fieldset legend="#{rsc.label_filtros}" toggleable="true"
				collapsed="true">
				<p:panelGrid columns="5">
					<p:outputLabel value="#{rsc.label_contaCedente} "
						for="acContaCedente" />

					<p:spacer />

					<p:autoComplete id="acContaCedente" minQueryLength="3" size="40"
						value="#{manterBoletoBean.filtro.nome}" effect="fade"
						maxResults="7"
						completeMethod="#{manterBoletoBean.autoCompleteNome}">
						<p:ajax event="change"
							listener="#{manterBoletoBean.buscarPorFiltros}"
							update="listaBoletos" />
					</p:autoComplete>

					<p:commandButton update="listaBoletos"
						actionListener="#{manterBoletoBean.buscarPorFiltros}"
						icon="ui-icon ui-icon-search" title="#{rsc.label_buscar}" />
				</p:panelGrid>
			</p:fieldset>

			<p:panel id="pnlListaBoletos" header="#{rsc.label_boletosGerados}"
				toggleable="true" toggleSpeed="500">

				<p:panelGrid columns="1" styleClass="full-width"
					columnClasses="full-width">
					<p:dataTable emptyMessage="#{msg.nenhumRegistroEncontrado}"
						var="boleto" id="listaBoletos" sortMode="multiple"
						widgetVar="listaBoletosWid" value="#{manterBoletoBean.entidades}"
						paginator="true" rows="10"
						paginatorPosition="#{rsc.label_paginationPosition}"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="10,50,150,200">

						<p:column headerText="#{rsc.label_contaCedente}"
							sortBy="#{boleto.contaCedente.nome}">
							<p:outputLabel value="#{boleto.contaCedente.nome}" />
						</p:column>

						<p:column headerText="#{rsc.label_valor}" sortBy="#{boleto.valor}">
							<p:outputLabel value="#{boleto.valor}" />
						</p:column>

						<p:column styleClass="coluna-acoes"
							headerText="#{rsc.label_acoes}">

						</p:column>
					</p:dataTable>
				</p:panelGrid>
			</p:panel>
			<p:watermark value="#{rsc.wm_nomeBoletoConsulta}" for="acContaCedente" />
		</h:form>

	</ui:define>
</ui:composition>

